5 x = { |phi, a, b| a * phi - (b * sin(phi)) };
6 y = { |phi, a, b| a - (b * sin(phi + 0.5pi)) };
9 GUI.cocoa; // use CocoaGUI (Mac OS X native)
10 GUI.swing; // use SwingGUI (Java based GUI)
14 w = GUI.window.new("Trochoid", Rect(128, 64, 800, 400)).front;
15 w.view.background_(Color.white);
17 pen.strokeColor = Color.black;
19 ((0..900) / 50).do { |phi|
20 var x0 = x.(phi, a, b);
21 var y0 = y.(phi, a, b);
22 pen.lineTo((50 * x0) @ (50 * y0 + 150));
34 ((0..100) / 25).do { |m|
44 // sonification of a trochoid
47 p = ProxySpace.push(s.boot); // enter
52 SinOsc.ar(500).dup * ~modulation.kr(2) * 0.04
59 LFSaw.kr(3).range(0, 2pi)
66 b = XLine.kr(0.1, 2, 30);
67 x = { |phi, a, b| a * phi - (b * sin(phi)) }.value(~phi.kr, a, b);
68 y = { |phi, a, b| a - (b * sin(phi + 0.5pi)) }.value(~phi.kr, a, b);